# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import flowOrAppConstants
from .appOperation import appOperationSubDirectiveTree
from .resourceFileOperation import resourceFileOperationSubDirectiveTree

class FlowOrAppSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(FlowOrAppSubDirectiveTree, self).__init__(parent)
        self.createFlowOrAppTreeNode()

    def createFlowOrAppTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "flowOrAppOperation"
        self.setText(0,"流程/应用")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, flowOrAppConstants.FlowOrAppConstants.callingFlowDirective, "调用流程")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, flowOrAppConstants.FlowOrAppConstants.callingModuleDirective, "调用模块")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, flowOrAppConstants.FlowOrAppConstants.quittingFlowDirective, "退出流程")
        #挂载流程或应用操作子节点
        appOperationSubDirectiveTree.AppOperationSubDirectiveTree(self)
        resourceFileOperationSubDirectiveTree.ResourceFileOperationSubDirectiveTree(self)
